<template>
	<view>
		<view class="content">
			<mp-html :content="html" />
		</view>
	</view>
</template>

<script>
import { getidInfo } from '@/common/http.api.js';
	export default {
		data() {
			return {
				html: '<div>Hello World!</div>'
			};
		},
		onLoad(e) {
			if(e.id == 2){
				uni.setNavigationBarTitle({
					title:'我的权益'
				})
				getidInfo({id:2}).then(res=>{
					if(res.code == 200){
						this.html = res.data.content
					}
				})
			}else if(e.id == 5){
				uni.setNavigationBarTitle({
					title:'关于我们'
				})
				getidInfo({id:3}).then(res=>{
					if(res.code == 200){
						this.html = res.data.content
					}
				})
			}else{
				uni.setNavigationBarTitle({
					title:'联系我们'
				})
				getidInfo({id:4}).then(res=>{
					if(res.code == 200){
						this.html = res.data.content
					}
				})
			}
		}
	}
</script>

<style lang="less">
	page {
		background-color: #F0F0F1;
	}
	.content {
		width: 716rpx;
		background-color: #fff;
		margin: 60rpx auto;
		border-radius: 10rpx;
		padding: 24rpx;
		box-sizing: border-box;
		min-height: 1000rpx;
	}
</style>